<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>水平垂直居中-浮动方法</title>
        <style>
            html,body {height: 100%;}
            #floater{
                float:left;
                height:50%;/*相对于父元素高度的50%*/
                margin-bottom: -120px;/*值大小为居中元素高度的一半（240px/2）*/
            }
            #content {
                clear:both;/*清除浮动*/
                height: 240px;
                position: relative;
            }
        </style>
    </head>
    <body>
        <div id="floater"><!--This block have empty content --></div>
        <div id="content">Content section</div>
    </body>
</html>